﻿using System;
using System.Configuration;
using System.Linq;

namespace BigMailer.Services
{
	public static class UserSettings
	{
		public static bool HasCredentials
		{
			get { return UserName.Length > 0; }
		}

		public static string UserName
		{
			get
			{
				string user = ConfigurationManager.AppSettings["bigmailer.username"];
				if ( user == null )
				{
					return string.Empty;
				}

				return user.Trim();
			}
		}

		public static string Password
		{
			get
			{
				string pw = ConfigurationManager.AppSettings["bigmailer.password"];
				if ( pw == null )
				{
					return string.Empty;
				}

				return pw.Trim();
			}
		}
	}
}